package com.taofuxn.yycreazy.ui.activity;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import com.taofuxn.yycreazy.R;
import com.taofuxn.yycreazy.ui.base.BaseActivity;
import com.taofuxn.yycreazy.ui.base.ToobarActivity;
import com.taofuxn.yycreazy.ui.view.RippleView;

import butterknife.InjectView;

/**
 * 关于我们
 * Created by wanghuafu on 16/9/15.
 */
public class AboutUsActivity extends ToobarActivity{

@InjectView(R.id.toolbar)
Toolbar toolbar;

    @InjectView(R.id.curVersion)
    TextView curVersion;

    @InjectView(R.id.checkUpdate)
    RippleView checkUpdate;
    @InjectView(R.id.scoreToUs)
    RippleView scoreToUs;


    @Override
    protected int setContentLayout() {
        return R.layout.activity_about_us;
    }

    @Override
    protected void init() {
        toolbar.setLogo(R.mipmap.logo);
        curVersion.setText(getVersionName());

        scoreToUs.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                Uri uri = Uri.parse("market://details?id="+getPackageName());
                Intent intent = new Intent(Intent.ACTION_VIEW,uri);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);
            }
        });

    }


    private String getVersionName() {

        return "当前版本：1.0.10 " +
                "";
    }
}
